package com.fla.aiba.api;

import com.fla.aiba.comm.config.Config;
import com.fla.aiba.repository.GiftRepository;
import com.fla.aiba.repository.GiftTypeRepository;
import com.jiai.core.tools.RestResultGenerator;
import com.jiai.exception.ServiceException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * Created by Administrator on 2017/3/28.
 */
@SuppressWarnings("SpringJavaAutowiringInspection")
@RequestMapping("/api/v1/live/gift")
@RestController
public class LiveGiftAPIContller {
    @Autowired
    private GiftRepository giftRepository;

    @Autowired
    private GiftTypeRepository giftTypeRepository;
    @Autowired
    private Config config;


    /**
     * 加载全部礼物
     * @return
     * @throws ServiceException
     */
    @RequestMapping(value="/loadAll",method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
    public Object loadGiftByAll()throws ServiceException {
        return RestResultGenerator.genSuccessResult(giftTypeRepository.findAll());

    }




}
